﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DDF.Data.Providers;
using System.Data;

namespace ARR.DataModel.Repositories
{
    public static partial class AttributesRepository
    {
        
        public static void TruncateTemporalTable()
        {
            using (SqlDataProvider database = new SqlDataProvider(connString, "{0}Cursor", "dbo"))
            {
                database.NewCommand("TRUNCATE TABLE TempArticleAttributes ", System.Data.CommandType.Text);

                database.ExecuteNonQuery();
            }
        }

        public static void UpdateFromTempArticleAttributes(int rangeReviewId)
        {
            using (SqlDataProvider database = new SqlDataProvider(connString, "{0}Cursor", "dbo"))
            {
                database.NewCommand("ArticleAttributes_UpdateFromTempArticleAttributes", CommandType.StoredProcedure);
                database.AddInParameter("@RangeReviewId", DbType.Int32, rangeReviewId);
                database.ExecuteNonQuery();
            }
        }
        
    }
}
